package com.wyzz.hr.pojo.base;

import java.io.Serializable;

import com.wyzz.hr.pojo.Authority;

public abstract class BaseAuthority implements Serializable {

	public BaseAuthority() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseAuthority(Integer id) {
		hashCode = 0x80000000;
		setId(id);
		initialize();
	}

	public BaseAuthority(Integer id, String authorityModuleNo) {
		hashCode = 0x80000000;
		setId(id);
		setAuthorityModuleNo(authorityModuleNo);
		initialize();
	}

	protected void initialize() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
		hashCode = 0x80000000;
	}

	public String getAuthorityModuleNo() {
		return authorityModuleNo;
	}

	public void setAuthorityModuleNo(String authorityModuleNo) {
		this.authorityModuleNo = authorityModuleNo;
	}

	public String getAuthorityActionNo() {
		return authorityActionNo;
	}

	public void setAuthorityActionNo(String authorityActionNo) {
		this.authorityActionNo = authorityActionNo;
	}

	public int getAuthorityConditionNo() {
		return authorityConditionNo;
	}

	public void setAuthorityConditionNo(int authorityConditionNo) {
		this.authorityConditionNo = authorityConditionNo;
	}

	public String getAuthorityDesc() {
		return authorityDesc;
	}

	public void setAuthorityDesc(String authorityDesc) {
		this.authorityDesc = authorityDesc;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Authority))
			return false;
		Authority authority = (Authority) obj;
		if (null == getId() || null == authority.getId())
			return false;
		else
			return getId().equals(authority.getId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public static String REF = "Authority";
	public static String PROP_AUTHORITY_DESC = "authorityDesc";
	public static String PROP_AUTHORITY_CONDITION_NO = "authorityConditionNo";
	public static String PROP_AUTHORITY_MODULE_NO = "authorityModuleNo";
	public static String PROP_AUTHORITY_ACTION_NO = "authorityActionNo";
	public static String PROP_ID = "id";
	private int hashCode;
	private Integer id;
	private String authorityModuleNo;
	private String authorityActionNo;
	private int authorityConditionNo;
	private String authorityDesc;

}
